package ioc;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Created by dycong on 2017/4/21.
 */
public class t {
   static ConfigurableApplicationContext configurableApplicationContext;

    public static void main(String[] args) {

        DefaultListableBeanFactory beanFactory=(DefaultListableBeanFactory)configurableApplicationContext.getBeanFactory();

        BeanDefinitionBuilder beanDefinition=BeanDefinitionBuilder.rootBeanDefinition(t.class);
        beanDefinition.addPropertyValue("","");
        beanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE);
        beanFactory.registerBeanDefinition("bean",beanDefinition.getBeanDefinition());
    }
}
